package com.shrct.businessprocess.purchase;

import com.shrct.businessprocess.project.RCCustomerContract;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.project.RCRealMoney;
import com.shrct.businessprocess.project.impl.RCCustomerContractImpl;
import edu.fudan.mylang.pf.BaseDataType;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

public class RCProjectContractSummary extends BaseDataType {
  public RCProjectContractSummary() {
    super();
  }
  
  private String customerName;
  
  public String getCustomerName() {
    return this.customerName;
  }
  
  public RCProjectContractSummary setCustomerName(final String customerName) {
    this.customerName = customerName;
    return this;			
    
  }
  
  @JoinColumn(name = "customerContract_id")
  @ManyToOne(targetEntity = RCCustomerContractImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCCustomerContract customerContract;
  
  public RCCustomerContract getCustomerContract() {
    return this.customerContract;
  }
  
  public RCProjectContractSummary setCustomerContract(final RCCustomerContract customerContract) {
    this.customerContract = customerContract;
    return this;			
    
  }
  
  @Embedded
  @AttributeOverrides(value = { @AttributeOverride(name = "amount", column = @Column(name = "totalContractAmount_amount") ), @AttributeOverride(name = "workaround", column = @Column(name = "totalContractAmount_workaround") ) } )
  @AssociationOverrides(value = @AssociationOverride(name = "exchange", joinColumns = @JoinColumn(name = "totalContractAmount_exchange") ) )
  private RCProjectMoney totalContractAmount = com.shrct.businessprocess.project.RCProjectMoney.create();
  
  public RCProjectMoney getTotalContractAmount() {
    return this.totalContractAmount;
  }
  
  public RCProjectContractSummary setTotalContractAmount(final RCProjectMoney totalContractAmount) {
    this.totalContractAmount = totalContractAmount;
    return this;			
    
  }
  
  @Embedded
  @AttributeOverrides(value = { @AttributeOverride(name = "amount", column = @Column(name = "totalInvoiceAmount_amount") ), @AttributeOverride(name = "workaround", column = @Column(name = "totalInvoiceAmount_workaround") ) } )
  @AssociationOverrides(value = @AssociationOverride(name = "exchange", joinColumns = @JoinColumn(name = "totalInvoiceAmount_exchange") ) )
  private RCProjectMoney totalInvoiceAmount = com.shrct.businessprocess.project.RCProjectMoney.create();
  
  public RCProjectMoney getTotalInvoiceAmount() {
    return this.totalInvoiceAmount;
  }
  
  public RCProjectContractSummary setTotalInvoiceAmount(final RCProjectMoney totalInvoiceAmount) {
    this.totalInvoiceAmount = totalInvoiceAmount;
    return this;			
    
  }
  
  @Embedded
  @AttributeOverrides(value = { @AttributeOverride(name = "amount", column = @Column(name = "totalInvoiceAndUnderInvoiceAmount_amount") ), @AttributeOverride(name = "workaround", column = @Column(name = "totalInvoiceAndUnderInvoiceAmount_workaround") ) } )
  @AssociationOverrides(value = @AssociationOverride(name = "exchange", joinColumns = @JoinColumn(name = "totalInvoiceAndUnderInvoiceAmount_exchange") ) )
  private RCProjectMoney totalInvoiceAndUnderInvoiceAmount = com.shrct.businessprocess.project.RCProjectMoney.create();
  
  public RCProjectMoney getTotalInvoiceAndUnderInvoiceAmount() {
    return this.totalInvoiceAndUnderInvoiceAmount;
  }
  
  public RCProjectContractSummary setTotalInvoiceAndUnderInvoiceAmount(final RCProjectMoney totalInvoiceAndUnderInvoiceAmount) {
    this.totalInvoiceAndUnderInvoiceAmount = totalInvoiceAndUnderInvoiceAmount;
    return this;			
    
  }
  
  @Embedded
  @AttributeOverrides(value = { @AttributeOverride(name = "amount", column = @Column(name = "totalIncomeAmount_amount") ), @AttributeOverride(name = "exchangeRate", column = @Column(name = "totalIncomeAmount_exchangeRate") ), @AttributeOverride(name = "workaround", column = @Column(name = "totalIncomeAmount_workaround") ) } )
  @AssociationOverrides(value = @AssociationOverride(name = "currencyType", joinColumns = @JoinColumn(name = "totalIncomeAmount_currencyType") ) )
  private RCRealMoney totalIncomeAmount = com.shrct.businessprocess.project.RCRealMoney.create();
  
  public RCRealMoney getTotalIncomeAmount() {
    return this.totalIncomeAmount;
  }
  
  public RCProjectContractSummary setTotalIncomeAmount(final RCRealMoney totalIncomeAmount) {
    this.totalIncomeAmount = totalIncomeAmount;
    return this;			
    
  }
  
  public static RCProjectContractSummary create() {
    return new RCProjectContractSummary();
    
    
  }
}
